const { defineConfig } = require('@vue/cli-service')
const autoprefixer = require('autoprefixer')
const pxtorem = require('postcss-pxtorem')
module.exports = defineConfig({
  lintOnSave: false,
  transpileDependencies: true,
  publicPath: '/tiyu/',
  devServer: {
    host: "0.0.0.0",
    port: 80,
    open: true,
    proxy: {
      "/api": {
        target: "http://127.0.0.1:8989",
        pathRewrite: {
          "/api": "",
        },
        changeOrigin: true,
      },
    },
  },
  css: {
    loaderOptions: {
      // postcss: {
      //   postcssOptions: {
      //     plugins: [
      //       autoprefixer(),
      //       pxtorem({
      //         rootValue: 75,
      //         propList: ['*'],
      //       }),
      //     ],
      //   }
      // },
      less: {
        lessOptions: {
          globalVars: {
            'primary-color': '#b4282d',
            'text-primary-color': '#212121',
            'text-gray-color': '#999999',
            'bg-color': '#f6f6f6',
            'bd-color': '#eeeeee',
            'font-family':
              'DINPro-Medium, DIN Alternate, "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif',
          },
        }
      },
    },
  }
})
